package com.xwzn.resident;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.xwzn.resident.adapter.BsznAdapter;
import com.xwzn.resident.model.Bszn;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description 办事指南界面
 * @Author HanKaiYang
 * @CreateDate 2019/12/23 11:05
 * @Version 1.0
 */
public class BsznActivity extends AppCompatActivity {

    private ImageView ivTitleBack;
    private RecyclerView rlvBszn;

    private List<Bszn> bsznList;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bszn);

        initView();
    }

    /**
     * @description 初始化视图
     * @author HanKaiYang
     * @createDate 2019/12/23 11:14
     * @version 1.0
     */
    private void initView() {
        ivTitleBack = (ImageView) findViewById(R.id.iv_title_back);
        ivTitleBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                onBackPressed();
            }
        });

        rlvBszn = (RecyclerView) findViewById(R.id.rlv_bszn);
        bsznList = new ArrayList<>();
        bsznList.add(new Bszn(R.drawable.personal_business, "个人办事", "查看个人办事"));
        bsznList.add(new Bszn(R.drawable.company_business, "企业办事", "查看企业办事"));
        BsznAdapter bsznAdapter = new BsznAdapter(bsznList);
        rlvBszn.setLayoutManager(new LinearLayoutManager(this));
        rlvBszn.setAdapter(bsznAdapter);

    }
}
